package org.dinnermate.validation;

public class ValidationTest
{
	public static void runTest(String[] inputs, Validator val)
	{
		for(String input : inputs)
		{
			if (val.validate(input))
				System.out.println("VALID - "+input);
			else
				System.out.println("NOT VALID - "+input);
		}
		
		System.out.println();
	}
	
	public static void main(String[] args)
	{
		// Test phone numbers
		String[] phoneNums = new String[5];
		phoneNums[0] = "123.456.7890";
		phoneNums[1] = "123-456-7890";
		phoneNums[2] = "abc-456-7890";
		phoneNums[3] = "1234567890";
		phoneNums[4] = "(123) 456-7890";
		
		runTest(phoneNums, new PhoneNumberValidator());
		
		// Test email addresses
		String[] emails = new String[5];
		emails[0] = "jeff@tjwallace.ca";
		emails[1] = "someemail.com";
		emails[2] = "jeff@crazyemail";
		emails[3] = "jeff@ther.nowayhose";
		emails[4] = "thomas.wallace@mail.mcgill.ca";
		
		runTest(emails, new EmailValidator());
		
		//Test prices
		String[] prices = new String[5];
		prices[0] = "00";
		prices[1] = "34";
		prices[2] = "4r";
		prices[3] = "rt";
		prices[4] = "446";
		
		runTest(prices, new PriceValidator());
	}
}
